$(document).on("click",".check-btn",function () {
    var o = {
        email:$("#oldEmail").text()
    }
    $.post(basePath+"send/send",o,function (map) {
        alert(map.message);
        if(map.success){
            emailIdentify(90);
        }
        $(".next-btn").attr("style","background-color: rgb(20, 130, 200);")

    })
})


$(document).on("click",".next-btn",function (e) {
    e.preventDefault();
    alert("llllllllllllllll")
    $(".next-step").show()
    $(".modul-div").hide();
    //判断邮箱验证码
    var identify = $("#code1").val();
    var object = {
        email : email,
        identify:identify
    };
    $.post(basePath+"reg/sendIdentify",object,function (hashMap) {
        console.log("验证码:   " + hashMap.success);
        if (!hashMap.success) {
            alert(hashMap.message);
            return;
        }
    })
})

function emailIdentify(time){
    if(time > 1){
        $(".check-btn").css("background-color","#ccc");
        time--;
        $(".check-btn").val(time+"s后重新发送");
        $(".check-btn").attr("disabled",true);
        setTimeout(function () {
            emailIdentify(time);
        },1000);

    }else{
        $(".check-btn").css("background-color","#008B8B");
        $(".check-btn").val("获取验证码");
        $(".check-btn").attr("disabled",false);
    }
};


